package com.study.controller;

import com.study.dto.AppVersionDto;
import com.study.entity.AppVersion;
import com.study.service.IAppVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("version")
public class AppVersionController {
    @Autowired
    private IAppVersionService appVersionService;
    @RequestMapping("view")
    public String view(Model model,Integer appId, String appName){
        AppVersion appVersion=new AppVersion();
        appVersion.setAppId(appId);
        List<AppVersion> list = appVersionService.findList(appVersion);
        AppVersionDto appVersionDto=new AppVersionDto();
        appVersionDto.setAppId(appId);
        appVersionDto.setAppName(appName);
        appVersionDto.setAppVersionList(list);
        model.addAttribute("appVersionDto",appVersionDto);
        return "/version/list";
    }
}
